<?php
namespace model\all;

class Row extends \sp\tree\Node{
    use \dk\traits\Rowrelation;

    public function __get($key){
        switch($key){
            case 'url':
                return url('index', $this->id);
        }
        if($value = parent::__get($key)){
            return $value;
        }
        return $this->getByRelation($key);
    }

    protected function getRelation(){
        return All::getInstance();
    }
    
    function __toString(){
        return $this->title;
    }
    
    protected function getRelationClass(){
        return \model\all\Relation::getInstance()->getRatlion();
    }

}